Conventionally, an image processing apparatus for enlarging/reducing an image in accordance with a distance between an input device and imaging targets (markers) is disclosed by Japanese Laid-Open Patent Publication No. 2007-236697 (hereinafter, referred to as Patent Document 1), for example. In the image processing apparatus disclosed by Patent Document 1, a controller has an image-pickup device for taking an image of two markers, and based on a distance between the two markers in the taken image, the distance between the input device and imaging targets (i.e., the markers) is calculated. Then, an image is: enlarged/reduced based on the calculated distance; placed on a position which corresponds to coordinates of a middle point between the two markers (e.g., a position pointed by the controller); and then displayed on a display device.
However, as shown in FIGS. 20A and 20B, in the case of the image processing apparatus disclosed by Patent Document 1, operability deteriorates when an area within which an image can be moved is fixed for images respectively having different enlargement ratios. In FIG. 20A, an area within which coordinates Pims, which indicate a position of an image IMs having a relatively low enlargement ratio, can be moved (movable area) is set. In the example of FIG. 20A, the movable area is set such that when the image IMs moves to a farthest edge of the movable area, almost the entire image IMs is displayed on a display screen, and a part of the image IMs is outside the display screen.
In FIG. 20B, similarly to the case of the image IMs, a movable area of coordinates Pimb is set for an image IMb having a relatively high enlargement ratio. In this case, the movable area is set such that when the image IMb moves to a farthest edge of the movable area, ¼ of the image IMs is displayed within the display area, and ¾ of the image IMs is outside the display area. Thus, in the case where the image IMb having a relatively high enlargement ratio is moved, as compared to the case where the image IMs is moved, when the image IMb is moved to the farthest edge of the movable area, a large portion of the image IMb remains within the display screen, and therefore it is likely that a user wishes to move the image IMb further to the outside of the movable are. However, such a wish of the user cannot be met since the movable area is fixed, and this results in operability deterioration for the user.
In the case of setting, assuming that the image IMb is to be moved, the movable area so as to extend to the outside of the display area, it is conceivable that if the image IMs having a relatively low enlargement ratio is moved within the movable area having extended to the outside of the display area, the image IMs disappears from the display area, and is not displayed on the display screen. In such a case, the user is unable to know where the image IMs is positioned, and this causes deterioration in operability.
Further, in the case where the image, which is placed on the position corresponding to the coordinates of the middle point between the two markers, is displayed on the display device, there is a possibility that the position to be designated varies depending on the distance between the controller and the markers. To be specific, in the case where the controller is operated at a remote position from the markers, even if a direction of the image-pickup device of the controller (i.e., direction in which the controller is pointed) is slightly changed, the designated position changes greatly, as compared to a case where the controller is operated near the markers. In other words, even if the user performs a same operation by using the controller, a result of the operation varies depending on the distance from the markers.
Therefore, a feature of the present invention is to solve at least one of the above-described problems, and to provide a storage medium storing an image processing program and an image processing apparatus which are capable of properly controlling a movement of an image in accordance with an enlargement ratio of the image or the distance between the image-pickup device and the imaging targets.
The present invention has the following features. Note that reference numerals, step numbers (here, “step” is abbreviated as “S”), diagram numbers and the like indicated between parentheses are merely provided to facilitate the understanding of the present invention in relation to the later-described best mode embodiment, rather than limiting the scope of the present invention in any way.
A first aspect of the present invention is a computer-readable storage medium storing an image processing program to be executed by a computer (10) of an image processing apparatus (5) for: enlarging or reducing an image (IM); placing the image on a predetermined placement position (Pim) in relation to a display area in accordance with a predetermined designation input (Da; (Lx, Ly), (Rx, Ry)); and displaying the image. The image processing program causes the computer to function as designation input obtaining means (CPU 10 performing steps 50 and 64; hereinafter, only step numbers are indicated), enlarging and reducing means (S55, S60), area setting means (S57), placement position calculation means (S58), image placing means (S61), and display control means (S62). The designation input obtaining means obtains the designation input. The enlarging and reducing means sets an enlargement ratio (Sx, Sy) of the image, and enlarges and reduces the image in accordance with the enlargement ratio. In accordance with the enlargement ratio (STx and STy calculated based on Sx and Sy) set by the enlarging and reducing means, the area setting means changes, in relation to the display area, an area within which the placement position is allowed to be set. The placement position calculation means calculates, based on the designation input obtained by the designation input obtaining means, a position within the area as the placement position, the position corresponding to the designation input. The image placing means places, on the placement position, the image enlarged and reduced by the enlarging and reducing means. The display control means causes a display device (2) to display the image placed by the image placing means. Note that, the area, within which the placement position is allowed to be set and which is set on the display area, may be in the same size as the display area, or smaller than the display area, or larger than the display area.
In a second aspect of the present invention based on the first aspect, the area setting means sets the area so as to extend in accordance with an increase in the enlargement ratio set by the enlarging and reducing means.
In a third aspect of the present invention based on the second aspect, the designation input obtaining means obtains the designation input from an input device (7) having an image-pickup device (74) for taking an image of a predetermined imaging target (8). The image processing program further causes the computer to function as distance calculation means (S52, S65) for calculating a distance (D) between the imaging target and the image-pickup device. The enlarging and reducing means increases the enlargement ratio in accordance with a decrease in the distance. The placement position calculation means calculates the placement position based on the enlargement ratio and a position of the imaging target in the image taken by the image-pickup device.
In a fourth aspect of the present invention based on the third aspect, the placement position calculation means calculates the placement position in the area set by the area setting means, by changing, based on the enlargement ratio, a rate of change of the placement position in relation to a change of the position of the imaging target in the taken image.
In a fifth aspect of the present invention based on the third aspect, a plurality of imaging targets are provided. The distance calculation means calculates a distance between the image-pickup device and the imaging targets, based on a distance (mi) between the imaging targets in the taken image.
In a sixth aspect of the present invention based on the fifth aspect, the computer is further caused to function as orientation calculation means (S54) and image orientation determination means (S59). The orientation calculation means calculates an orientation of the input device, based on a gradient (Db1) between the imaging targets in the taken image. The image orientation determination means determines an orientation (Aim) of the image in accordance with the orientation of the input device. The image placing means places, in the orientation determined by the image orientation determination means, the image enlarged and reduced by the enlarging and reducing means.
In a seventh aspect of the present invention based on the first aspect, the area setting means uses an aspect ratio of the image, thereby changing an aspect ratio of the area which is changed in accordance with the enlargement ratio.
In an eighth aspect of the present invention based on the seventh aspect, the computer is further caused to function as image orientation determination means for determining an orientation of the image in accordance with the designation input. The area setting means uses the aspect ratio and the orientation of the image, thereby changing the aspect ratio of the area which is changed in accordance with the enlargement ratio.
A ninth aspect of the present invention is a computer-readable storage medium storing an image processing program to be executed by a computer of an image processing apparatus for: placing the image on a predetermined placement position in relation to a display area in accordance with a designation input obtained from an input device having image-pickup means for taking an image of an imaging target; and displaying the image. The image processing program causes the computer to function as designation input obtaining means, distance calculation means, placement position calculation means, image placing means and display control means. The designation input obtaining means obtains the designation input from the input device. The distance calculation means calculates, based on a position of the imaging target in the taken image, a distance between the imaging target and the image-pickup means. Based on the distance, the placement position calculation means changes a rate of change of the placement position in relation to a change of the position of the imaging target in the taken image, thereby calculating the placement position. The image placing means places the image on the placement position. The display control means causes a display device to display the image placed by the image placing means.
In a tenth aspect of the present invention based on the ninth aspect, the placement position calculation means calculates the placement position in such a manner as to increase the rate of change of the placement position in accordance with a decrease in the distance calculated by the distance calculation means.
In an eleventh aspect of the present invention based on the tenth aspect, the computer is further caused to function as area setting means for, in accordance with the distance calculated by the distance calculation means, changing, in relation to the display area, an area within which the placement position is allowed to be set. The area setting means sets the area so as to extend in accordance with a decrease in the distance calculated by the distance calculation means.
In a twelfth aspect of the present invention based on the ninth aspect, a plurality of imaging targets are provided. The distance calculation means calculates a distance between the image-pickup means and the imaging targets, based on a distance between the imaging targets in the taken image.
A thirteenth aspect of the present invention is an image processing apparatus for: enlarging or reducing an image; placing the image on a predetermined placement position in a display area of a display device in accordance with a predetermined designation input; and displaying the image. The image processing apparatus comprises designation input obtaining means, enlarging and reducing means, area setting means, placement position calculation means, image placing means and display control means. The designation input obtaining means obtains the designation input. The enlarging and reducing means sets an enlargement ratio of the image, and enlarges and reduces the image in accordance with the enlargement ratio. In accordance with the enlargement ratio set by the enlarging and reducing means, the area setting means changes, in relation to the display area, an area within which the placement position is allowed to be set. The placement position calculation means calculates, based on the designation input obtained by the designation input obtaining means, a position within the area as the placement position, the position corresponding to the designation input. The image placing means places, on the placement position, the image enlarged and reduced by the enlarging and reducing means. The display control means causes a display device to display the image placed by the image placing means.
In a fourteenth aspect of the present invention based on the thirteenth aspect, the area setting means sets the area so as to extend in accordance with an increase in the enlargement ratio set by the enlarging and reducing means.
In a fifteenth aspect of the present invention based on the fourteenth aspect, the designation input obtaining means obtains the designation input from an input device having an image-pickup device for taking an image of a predetermined imaging target. The image processing apparatus further comprises distance calculation means for calculating a distance between the imaging target and the image-pickup device. The enlarging and reducing means increases the enlargement ratio in accordance with a decrease in the distance. The placement position calculation means calculates the placement position based on the enlargement ratio and a position of the imaging target in the image taken by the image-pickup device.
A sixteenth aspect of the present invention is an image processing apparatus for: placing an image on a predetermined placement position in relation to a display area of a display device in accordance with a designation input obtained from an input device having image-pickup means for taking an image of an imaging target; and displaying the image. The image processing apparatus comprises designation input obtaining means, distance calculation means, placement position calculation means, image placing means and display control means. The designation input obtaining means obtains the designation input from the input device. The distance calculation means calculates, based on a position of the imaging target in the taken image, a distance between the imaging target and the image-pickup means. The placement position calculation means changes, based on the distance, a rate of change of the placement position in relation to a change of the position of the imaging target in the taken image, thereby calculating the placement position. The image placing means places the image on the placement position. The display control means causes a display device to display the image placed by the image placing means.
In a seventeenth aspect of the present invention based on the sixteenth aspect, the placement position calculation means calculates the placement position in such a manner as to increase the rate of change of the placement position in accordance with a decrease in the distance calculated by the distance calculation means.
In an eighteenth aspect of the present invention based on the thirteenth aspect, the image processing apparatus further comprises area setting means for, in accordance with the distance calculated by the distance calculation means, changing, in relation to the display area, an area within which the placement position is allowed to be set. The area setting means sets the area so as to extend in accordance with a decrease in the distance calculated by the distance calculation means.
According to the above first aspect, the area within which the image can be moved (i.e., movable area) is set in accordance with the enlargement ratio of the image. This allows the movable area of the image to be set appropriately in accordance with the size of the image, and allows the movement of the image to be properly controlled in accordance with the enlargement ratio of the image.
According to the above second aspect, operability deterioration, such as the movable area becoming insufficient for an image having a high enlargement ratio, is prevented. Further, for an image having a low enlargement ratio, i.e., for an image displayed in a reduced size, the movable area is also in a reduced size. This prevents the image from disappearing from the display area.
According to the above third aspect, when the input device is moved toward the imaging target, the displayed image is enlarged, and the area within which the image can be moved is also enlarged. On the other hand, when the input device is moved away from the imaging target, the displayed image is reduced, and the area within which the image can be moved is also reduced. Thus, the image enlargement/reduction process can be performed only by changing the distance between the input device and imaging target, that is, the enlargement ratio of the displayed image can be changed by a simple operation. Also, the displayed image moves in response to the input device having been moved from side to side and up and down with respect to the imaging target. Thus, the displayed image can be moved by a simple operation.
According to the above fourth aspect, when the image is to be displayed at a position pointed by the input device, a designated moving amount of the image is greater in the case where the input device is positioned near the imaging target than in the case where the input device is at a remote position from the imaging target. As a result, increase/decrease, caused by a difference in distance between the input device and imaging target, of the moving amount of the image in relation to an amount of change in the position pointed by the input device, is lessened. In other words, for a user using the input device to perform an operation to move the pointed position, a significant change in operability does not occur even if the distance between the input device and the imaging target changes. This allows the user to perform the operation without feeling discomfort.
According to the above fifth aspect, the distance between the image-pickup device and the imaging targets can be easily calculated by using a distance between at least two imaging targets in the image taken by the input device.
According to the above sixth aspect, by performing such an operation as to twist the input device to the right and left, the user can cause the displayed image to rotate in accordance with the operation.
According to the above seventh aspect, the area within which the image can be moved is set based on the aspect ratio of the image. As a result, the movable area is set appropriately in accordance with a shape of the image, e.g., the image having a vertically long shape or a horizontally long shape.
According to the above eighth aspect, the area within which the image can be moved is set in accordance with the orientation of the image. As a result, the movable area can be set appropriately in accordance with, e.g., a change in the placement angle of the vertically-long-shaped or horizontally-long-shaped image, i.e., in accordance with the shape and placement angle of the image.
According to the above ninth aspect, the increase/decrease, caused by a difference in distance between the input device and imaging target, of the moving amount of the image in relation to the amount of change in the position pointed by the input device, can be adjusted. For example, when the image is to be displayed on the position pointed by the input device, even if an operation to move the pointed position is performed in a same manner, the moving amount of the pointed position changes depending on the distance between the input device and imaging target. Then, the moving amount of the image, which moves in response to the movement of the pointed position, increases/decreases accordingly. However, by adjusting the moving amount of the image in accordance with the distance between the input device and imaging target, operability related to the moving amount of the image, which moving amount is in response to an operation performed by the user to move the pointed position by using the input device, can be adjusted. This allows the user to perform the operation without feeling discomfort.
According to the above tenth aspect, when the image is to be displayed at the position pointed by the input device, a designated moving amount of the image is greater in the case where the input device is positioned near the imaging target than in the case where the input device is at a remote position from the imaging target. As a result, the increase/decrease, caused by a difference in distance between the input device and imaging target, of the moving amount of the image in relation to the amount of change in the position pointed by the input device, is lessened. In other words, for the user using the input device to perform an operation to move the pointed position, a significant change in operability does not occur even if the distance between the input device and the imaging target changes. This allows the user to perform the operation without feeling discomfort.
According to the above eleventh aspect, the area, within which the image can be moved, can be adjusted in size in accordance with the distance between the input device and imaging target, and the movable area can be enlarged in accordance with a decrease in the distance between the input device and imaging target.
According to the above twelfth aspect, the distance between the image-pickup device and the imaging targets can be easily calculated by using a distance between at least two imaging targets in the image taken by the input device.
According to the image processing apparatus of the present invention, the same effect as that provided by the above-described storage medium storing the image processing program can be obtained.
These and other objects, features, aspects and advantages of the present invention will become more apparent from the following detailed description when taken in conjunction with the accompanying drawings.